import json
import rsa
import pickle

license_data = {
    "original_project_Author": "KitChen",
    "softwareVersion": "1.0.0",
    # 其他 license 信息...
}
license_json = json.dumps(license_data, sort_keys=True).encode('utf-8')


with open('signature.bin', 'rb') as f:
    # 读取bytes数据
    encrypted_message = f.read()


with open('private_key.pem', 'rb') as f_priv:
    private_key = pickle.load(f_priv)

decrypted_message = rsa.decrypt(encrypted_message, private_key)

print(type(decrypted_message),type(license_json))

if decrypted_message == license_json:
    print("valid")
else:
    print("wrong")

assert decrypted_message == license_json
